$(function () {
    function readURL(input) {
        if (input.files && input.files[0]) {
            var reader = new FileReader();
            reader.onload = function (e) {
                $('#photo').attr('src', e.target.result);
            };
            reader.readAsDataURL(input.files[0]);
        }
    }

    $('.custom-image-uploader img, .custom-image-uploader a').click(function () {
        $('#id_reviewer-photo').click();
        return false;
    });

    $("#id_reviewer-photo").click(function(){
        readURL(this);
    });
});